{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "cWpo9q7lkR8X"
   },
   "source": [
    "# Check what processor Colab made avaiable to you:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "IabsZDECZCDg"
   },
   "outputs": [],
   "source": [
    "import torch\n",
    "torch.cuda.get_device_name(0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "RqA5RLmRkdRN"
   },
   "source": [
    "# Clone the project"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "xEobV2KCMX3H"
   },
   "outputs": [],
   "source": [
    "!git clone https://github.com/HeylonNHP/Dain-App.git"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "tBWM7qAOkrbJ"
   },
   "source": [
    "# Build Scripts\n",
    "This can take between 5 and 20 minutes.\n",
    "\n",
    "Colab may use pytorch < 1.7: Giving a error for the architecture >= 8.0 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "URLAK9tpMrnD"
   },
   "outputs": [],
   "source": [
    "%%bash\n",
    "cd /content/Dain-App/my_package\n",
    "sh build.sh"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "1rZ-ffN2Mr-v"
   },
   "outputs": [],
   "source": [
    "%%bash\n",
    "cd /content/Dain-App/PWCNet/correlation_package_pytorch1_0\n",
    "sh build.sh"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "CuoQJgZcaBSt"
   },
   "source": [
    "# Install packages:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "nqU0Clo5YAoK"
   },
   "outputs": [],
   "source": [
    "!pip install PyQt5\n",
    "!sudo add-apt-repository -y ppa:jonathonf/ffmpeg-4\n",
    "!sudo apt update\n",
    "!sudo apt -y install ffmpeg"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "nelPNg-2ZY1w"
   },
   "source": [
    "#Run:\n",
    "Interpolation Mode 3 and 4 require a newer FFMPEG that Colab comes by default."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "hv5G4rrNaSiE"
   },
   "outputs": [],
   "source": [
    "%cd /content/Dain-App\n",
    "!python  my_design.py -cli -h"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "ZaSHdzQWXobS"
   },
   "outputs": [],
   "source": [
    "%cd /content/Dain-App\n",
    "!python  my_design.py -cli --input \"/content/Dain-App/example.mp4\" -o \"/content/Dain-App/example_folder/\" -on \"interpolated.mp4\" -m \"model_weights/best.pth\" -fh 2 --interpolations 2 --depth_awarenes 0 --loop 0 -p 0 --alpha 0 --check_scene_change 10 --png_compress 0 --crf 1 --pixel_upscale_downscale_before 1 --pixel_downscale_upscale_after 1 --pixel_upscale_after 1 --mute_ffmpeg 0 --split_size_x -1 --split_size_y -1 --split_pad 150 --half 0 --step_extract 1 --step_interpolate 1 --batch_size 1 --use_benchmark 0 --force_flow 1 --smooth_flow 0 --downscale -1 --fast_mode 0"
   ]
  }
 ],
 "metadata": {
  "accelerator": "GPU",
  "colab": {
   "collapsed_sections": [],
   "name": "Dain-App Colab.ipynb",
   "provenance": [],
   "toc_visible": true
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
